<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
   <%@ taglib  
	uri="http://java.sun.com/jsp/jstl/core"
	prefix="c"%>	
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>管理者_0</title>
<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet">
<style type="text/css">

#botton_value{
visibility: hidden;
}
 </style>
</head>

<div id="botton_value">
<input id="item_id_value" value="${item_id}">
<input id="item_intime_value" value="${item_intime}">
<input id="item_outtime_value" value="${item_outtime}">
<input id="flyman_id_value" value="${flyman_id}">
<input id="item_status_value" value="${item_status}">
</div>
     <div class ="col-lg 6">
      <p class=button-group>
      <button type="button" class="btn btn-promary btn-lg btn-default"onclick="search()" >查询运件</button>
      <button type="button" class="btn btn-promary btn-lg btn-default col-md-offset-9" onclick="back()">返回登录界面</button>
      
     </p>
     </div>
     <div id="contains">
      <form action="" method="post">   
      <div class ="col-lg-12 table-resonsive">
    
         <table class="table able-striped  ">
         <thead>
         <tr>
         <th><button type="button" class="btn btn-promary btn-lg btn-block"onclick="item_id()" > 运件编号</button></th>
          <th><button type="button" class="btn btn-promary btn-lg btn-block" onclick="item_intime()" > 入库时间</button></th>
          <th><button type="button" class="btn btn-promary btn-lg btn-block" onclick="item_outtime()" > 出库时间</button></th>
          <th><button type="button" class="btn btn-promary btn-lg btn-block" onclick="flyman_id()" "> 负责快递员编号</button></th>
          <th><button type="button" class="btn btn-promary btn-lg btn-block" onclick="item_status()"> 运件状态</button></th>
         
          <th></th>
         </tr>
         </thead>
         <tbody>
         <c:forEach var="item" items="${item}">
         <tr> 
         <td><p class="form-control-static" id="item_id">${item.goods_id}</p></td>
         <td><p class="form-control-static" id="item_intime">${item.goods_intime}</p></td>
         <td><p class="form-control-static" id="item_outtime">${item.goods_outtime}</p></td>
         <td> <p class ="form-group">
         <select class="form-control" id="flyman_id_option" name="flyman_id_option">
         <option  value=${item.del_id}>${item.del_id}</option>
       <option  value="1">1</option>
        <option  value="2">2</option>
         <option  value="3">3</option>
         </select>
         </p>
         </td>
         
         <td>
         <p class ="form-group">
         <select class="form-control" id="item_status_option" name="item_status_option">
         <option  value=${item.goods_state}>${item.goods_state}</option>
       <option  value="1">1</option>
        <option  value="2">2</option>
         <option  value="3">3</option>
         </select>
         </p>
       </td>
         
         <td>
         <div class=botton-group>
         <button type="button" class="btn btn-promary btn-lg"  onclick="change()">修改状态</button>
       
         </div>
         </td>
         
         </tr>
         </c:forEach>
         </tbody>
         
         </table>
         </div>
         </form>
         </div>
</body>
<script type="text/javascript" src="bootstrap/js/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript">
function search(){
	window.open("search_item.jsp","查询运件","height=450,width=200,top=200,left=600,resizable=yes,location=yes,status=no,fullscreen=yes");
}
function item_id()
{
var item_id=document.getElementById("item_id_value").value;
if(item_id=="1")
	{
	window.location.href="controller_list_by_itemid_Servlet";
	}
else {
	window.location.href="controller_list_Servlet";
}
}
function item_intime()
{
var item_intime=document.getElementById("item_intime_value").value;
if(item_intime=="0")
	{
	window.location.href="controller_list_by_intime_asc_Servlet";
	}
else {
	window.location.href="controller_list_by_intime_desc_Servlet";
}
}
function item_outtime()
{
var item_outtime=document.getElementById("item_outtime_value").value;
if(item_outtime=="0")
	{
	window.location.href="controller_list_by_outtime_asc_Servlet";
	}
else {
	window.location.href="controller_list_by_outtime_desc_Servlet";
}}

function flyman_id()
{
var flyman_id=document.getElementById("flyman_id_value").value;
if(flyman_id=="0")
	{
	window.location.href="controller_list_by_flyman_id_asc_Servlet";
	}
else {
	window.location.href="controller_list_by_flyman_id_desc_Servlet";
}}

function item_status()
{
var item_status=document.getElementById("item_status_value").value;
if(item_status=="0")
	{
	window.location.href="controller_list_by_item_status_asc_Servlet";
	}
else {
	window.location.href="controller_list_by_item_status_desc_Servlet";
}}

function change(){
	var item_id=document.getElementById('item_id').innerHTML;
	var a=document.getElementById("flyman_id_option");
	var flyman_id_option=a.options[a.selectedIndex].value;
	var a1=document.getElementById("item_status_option");
	var item_status_option=a1.options[a1.selectedIndex].value;
	
	jQuery.post("controller_change_Servlet",
			 {"item_id":item_id,"flyman_id":flyman_id_option,"item_status":item_status_option},
			 function(rst){
				 if(rst ==1)
					{
						alert("操作成功！");
					}else{
						alert("操作失败！");
					}}
			 );
}
function back(){
	top.location.href="controller_search.jsp"
}


</script>
</html>